<template>
  <el-card class="app-container">
    <c-u-r-d-table :option="option"/>
  </el-card>
</template>

<script>

import ColumnType from '@/framework/constant/ColumnType'
import OnlineStatusEnum from '@/framework/constant/OnlineStatusEnum'
import { backendCategoryApi } from '@/feature/pdt/infra/api/backendCategoryApi'
import CURDTable from '@/framework/components/table/CURDTable'
import YesNoEnum from '@/infra/constant/YesNoEnum'

export default {
  components: { CURDTable },
  data() {
    return {
      option: {
        showSelection: false,
        requestApi: backendCategoryApi,
        columns: [
          {
            label: '标题',
            searchable: true,
            width: 'auto',
            required: true,
            prop: 'title'
          },
          {
            label: '类目简介',
            prop: 'intro'
          },
          {
            label: '父类目',
            prop: 'parentId',
            searchable: true
          },
          // {
          //   label: '类目排序',
          //   prop: 'sortNum',
          //   type: ColumnType.NUMBER
          // },
          {
            label: '状态',
            searchable: true,
            type: ColumnType.RADIO,
            hiddenInForm: true,
            options: OnlineStatusEnum,
            prop: 'status'
          },
          {
            label: '等级',
            prop: 'level',
            type: ColumnType.NUMBER
          },
          {
            label: '首字母',
            prop: 'firstLetter'
          },
          {
            label: '是否叶子节点',
            prop: 'isLeaf',
            type: ColumnType.RADIO,
            options: YesNoEnum
          },
          {
            label: '大类名称',
            prop: 'stapleName'
          },
          {
            label: '创建时间',
            type: ColumnType.DATETIME,
            hiddenInForm: true,
            prop: 'gmtCreate'
          },
          {
            label: '修改时间',
            type: ColumnType.DATETIME,
            hiddenInForm: true,
            prop: 'gmtModified'
          }
        ]
      }
    }
  },
  methods: {}
}
</script>

